var resourceUrl = getApp().request("imgUrl");
var app = getApp().globalData; 
Page({

  /**
   * 页面的初始数据
   */
  data: {
    resourceUrl: resourceUrl 
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    wx.showShareMenu({
      withShareTicket: true
    });
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    //是否选车
    var fightCarTypeId = app.fightCarTypeId;
    //随机一句宣言
    var declaration = getApp().Refit();
    var myRefitTxt = Math.floor(Math.random() * declaration.length);
    if (fightCarTypeId == 0) {
      return {
        title: getApp().shareTitle1(),
        path: "/pages/index/index"
      }
    } else {
      return {
        title: getApp().shareTitle2(),
        path: "/pages/openShare/openShare?shareId=" + app.session_key.userId + "&carTypeId=" + fightCarTypeId + "&shareRefitNum=" + myRefitTxt + "&carName=SUV概念车",
        success: (re) => {
          if (Object.keys(re).length == 1) {
            return
          }
          var ticket = re.shareTickets[0];
          getApp().shareFn(ticket);
        }
      }
    }
  },
  //点击去看什么是SUV
  btnWhatIsSuv:function(){
    wx.navigateTo({
      url: '../whatIsSuv/whatIsSuv?id=whatIsSuv',
    })
  },
  //如何定制一辆概念车
  btnGameStrategy: function () {
    wx.navigateTo({
      url: '../whatIsSuv/whatIsSuv?id=gameStrategy',
    })
  },
  //概念车描述
  btnConceptCarDes: function () {
    wx.navigateTo({
      url: '../whatIsSuv/whatIsSuv?id=ConceptCarDes',
      //url: '../video/video',
    })
  }
})